package com.antu.first.service;

import com.antu.first.bean.Merchant;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by 徐兴 on 2018/3/3
 */
public interface MerchantLogionService {
    /**
     * 商家登录
     * @param merchant 商家对象
     * @param request 请求
     * @return map集合
     */
    public Map<String,Object> merchantlogin(Merchant merchant,HttpServletRequest request) throws Exception;

    /**
     * 修改商家在线状态
     * @param merchant 商家对象
     * @return map集合
     */
    public int updateMerchantIsOnline(Merchant merchant) throws Exception;

    /**
     * 在用户关闭浏览器或者退出登录时修改商家在线状态
     * @param merchant 商家对象
     * @return 影响行数
     */
    public Map<String,Object> updateMerchantIsOnlineAfterExit(Merchant merchant) throws Exception;
    /**
     * 商家忘记密码
     * @param mNewPassword 新密码
     * @param mCode 手机验证码
     * @param request 商家请求
     * @return map集合
     */
    public  Map<String,Object> merchantForgetPassword(String mNewPassword,String mCode,HttpServletRequest request) throws Exception;

    /**
     * 验证商家手机号码，产生验证码
     * @param mPhone 商家电话
     * @return 验证码
     */
    public Map<String,Object> validateMerchantPhone(String mPhone,HttpServletRequest request) throws Exception;
    /**
     * 根据电话号码查商家
     * @param mPhone 商家电话号码
     * @return map集合
     */
    public Merchant selectMerchantByPhone(String mPhone);
}
